import { stringify } from 'qs';
import request from '@/utils/request';


/**
 * 查询
 * @param {*} params 
 */
export async function queryCoachAndSaleList(params) {
  return request('/sys/user/queryCoachAndSaleList', {
    method: 'POST',
    data: {
      ...params
    },
  });
}

/**
 * 根据用户信息查询场馆List
 * @param {*} params 
 */
export async function fetchShopList(params) {
  return request('/venueInfo/queryVenueInfoListByUserId', {
    method: 'POST',
    requestType:'form',
    data: { ...params },
  });
}

/**
 * 查询角色List
 * @param {*} params 
 */
export async function fetchRoleList(params) {
  return request('/sys/role/list', {
    method: 'POST',
    data: { 
      pageNum:1,
      pageSize:10000,
      ...params
     },
  });
}

/**
 * 根据ID查询客户信息
 * @param {*} params 
 */
export async function fetchEmployee(params) {
  return request(`/sys/user/edit/${params.id}`);
}

/**
 * 批量删除
 * @param {*} params 
 */
export async function batchRemoveEmployee(params) {
  return request(`/sys/user/batchRemove?${stringify(params, { arrayFormat: 'brackets' })}`);
}

/**
 * 上传
 * @param {*} params 
 */
export async function upload(params) {
  return request('/commonInfo/uploadFile', {
    method: 'POST',
    data: params,
  });
}

/**
 * 新增User
 * @param {*} params 
 */
export async function addUser(params) {
  return request('/sys/user/save', {
    method: 'POST',
    data: { ...params },
  });
}

/**
 * 编辑User
 * @param {*} params 
 */
export async function updateUser(params) {
  return request('/sys/user/update', {
    method: 'POST',
    data: { ...params },
  });
}

/**
 * 批量删除场地
 * @param {*} params 
 */
export async function batchRemoveSite(params) {
  return request(`/siteInfo/batchDeleteSiteInfoByIds?${stringify(params, { arrayFormat: 'repeat' })}`);
}


/**
 * 固定工资List
 * @param {*} params 
 */
export async function gdWageList(params) {
  return request('/salaryDesign/querySalaryDesignList?salaryType=1', {
    method: 'GET',
  });
}

/**
 * 销售提成List
 * @param {*} params 
 */
export async function saleWageList(params) {
  return request('/salaryDesign/querySalaryDesignList?salaryType=2', {
    method: 'GET',
  });
}

/**
 * 私教课费List
 * @param {*} params 
 */
export async function privateWageList(params) {
  return request('/salaryDesign/querySalaryDesignList?salaryType=3', {
    method: 'GET',
  });
}